Skip to content

Conversation

@timrid
Copy link
Contributor

@timrid timrid commented Jul 3, 2025

This PR adds the possibility to forward/reverse a port to an Android app via ADB.

I needed the forwarding/reversing for adding debug capabilitys to Android in #2351. But now I also have another use case, where I want to connect the android app to a REST-Server running on my host system. So I though it would be generally a useful feature for briefcase.

PR Checklist:

  • All new features have been tested
  • All new features have been documented
  • I have read the CONTRIBUTING.md file
  • I will abide by the code of conduct

Copy link
Member

@mhsmith mhsmith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this is very good. Obviously it only works when the app is launched via Briefcase, but like --shutdown-on-exit, it could still be useful for all kinds of scripted situations.

@timrid
Copy link
Contributor Author

timrid commented Jul 8, 2025

Obviously it only works when the app is launched via Briefcase, but like --shutdown-on-exit, it could still be useful for all kinds of scripted situations.

Yes, that was the intention of these options.

If you need a permanent connection to the Android device, you would have to use ADB manually. For this it would also be practical to have access to the ADB downloaded by briefcase. E.g. via a new command briefcase tool adb. Then you would use briefcase tool adb forward tcp:5555 tcp:6666 to have a permanent connection. And to close this connection you can use briefcase tool adb forward tcp:5555 --remove. This would give you complete freedom to do every configuration with ADB without searching for the path where ADB is downloaded or manually downloading ADB. But this would be a different feature.

@mhsmith
Copy link
Member

mhsmith commented Jul 8, 2025

There are some similar ideas in #747.

@timrid timrid requested a review from mhsmith July 9, 2025 18:36
@mhsmith mhsmith merged commit ac89f8a into beeware:main Jul 10, 2025
57 checks passed
@timrid timrid deleted the feature/adb-forward-reverse-port-option branch August 16, 2025 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants